|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnegotiator.Timeline
negotiator.DiscreteTimeline
public class DiscreteTimeline
Implementation of the timeline in which time is divided in rounds. Time does not pass within a round. Note that requesting the total time is in this case weird.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class negotiator.Timeline |
|---|
Timeline.Type |
| Field Summary |
|---|
| Fields inherited from class negotiator.Timeline |
|---|
hasDeadline, paused |
| Constructor Summary | |
|---|---|
DiscreteTimeline(int totalRounds)
Creates a timeline with a deadline of totalRounds number of rounds. |
|
| Method Summary | |
|---|---|
double |
getCurrentTime()
|
int |
getOwnRoundsLeft()
The number of rounds left for ourself. |
int |
getRound()
Starting to count from 1, until the total amount of rounds. |
int |
getRoundsLeft()
|
double |
getTime()
Gets the time, running from t = 0 (start) to t = 1 (deadline). |
int |
getTotalRounds()
Be careful, this is not equal to the initializing value! |
double |
getTotalTime()
This a hack because in Agent.java a method sleep requires this |
Timeline.Type |
getType()
|
void |
increment()
|
void |
pause()
The DiscreteTimeline does not have to be paused/resumed, as time does not pass within a round. |
void |
printRoundElapsed()
Prints time in seconds |
void |
printTime()
Prints time, running from t = 0 (start) to t = 1 (deadline). |
void |
resume()
The DiscreteTimeline does not have to be paused/resumed, as time does not pass within a round. |
| Methods inherited from class negotiator.Timeline |
|---|
isDeadlineReached, isPaused |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiscreteTimeline(int totalRounds)
totalRounds number of rounds.
| Method Detail |
|---|
public void printRoundElapsed()
public void printTime()
printTime in class Timelinepublic double getTime()
Agent#wait(double) for pausing the agent.
getTime in class Timelinepublic void increment()
public void pause()
pause in class Timelinepublic void resume()
resume in class Timelinepublic double getTotalTime()
getTotalTime in class Timelinepublic int getRound()
public int getRoundsLeft()
public int getTotalRounds()
public int getOwnRoundsLeft()
public Timeline.Type getType()
getType in class Timelinepublic double getCurrentTime()
getCurrentTime in class Timeline
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||